
#include once "../inc/gfx.bi"
#include once "../inc/map.bi"
#include once "ext/graphics/img_load.bi"
#include once "ext/graphics.bi"


extern bomber as ext.gfx.sprite ptr
extern console as uinteger

Dim as ext.gfx.sprite ptr bomber

sub loadSprites()  
   
   bomber = new ext.gfx.sprite[5]
   
   ' Load the bomber first
   for i as integer = 1 to 4
      
      bomber[i].init(8) '8 frames per sprite
     
      for j as integer = 0 to 7
         
         dim as fb.image ptr temp
      
         temp = ext.LoadImage("res/gfx/bomber/bomber" & i & "_"  & j & ".png")
                                
         if (temp = 0) then
         
            ? "Error loading file : " & "bomber" & i & "_" & j & ".png!"
            ? Err
            sleep
            end
            
         else
            
            bomber[i].SetImage(j,temp)
            
         end if
         
      next
      
   next
   
   ' load tiles
   '' --- already done in map.bas while loading map   
   
   ' load monsters
   ' still needs to be drawn :p
   
   ' load powerups
   
   
   

end sub

sub UnloadSprites()
   
   print #console, "Unloading Bomberman..."
   for i as integer = 1 to 4
      for j as integer = 0 to 7
      
         bomber[i].DeleteImage(j)
      
      next j
   next i

   'if (bomber <> 0) then delete(bomber)

end sub
